# SPDX-License-Identifier: Apache-2.0
# (C) Copyright IBM Corp. 2024.
# Licensed under the Apache License, Version 2.0 (the “License”);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#  http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an “AS IS” BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
import os

from data_processing.test_support.launch.transform_test import (
    AbstractTransformLauncherTest,
)
from data_processing_ray.runtime.ray import RayTransformLauncher
from dpk_gneissweb_classification.ray.runtime import ClassificationRayTransformConfiguration
from dpk_gneissweb_classification.transform import (
    content_column_name_cli_param,
    model_credential_cli_param,
    model_file_name_cli_param,
    model_url_cli_param,
    output_label_column_name_cli_param,
    output_score_column_name_cli_param,
)

class TestRayLangIdentificationTransform(AbstractTransformLauncherTest):
    """
    Extends the super-class to define the test data for the tests defined there.
    The name of this class MUST begin with the word Test so that pytest recognizes it as a test class.
    """

    def get_test_transform_fixtures(self) -> list[tuple]:
        basedir = "../test-data"
        basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), basedir))
        config = {
            model_file_name_cli_param: ["fasttext_medical.bin"],
            model_url_cli_param:["ibm-granite/GneissWeb.Med_classifier"],
            content_column_name_cli_param: "text",
            output_label_column_name_cli_param: ["label_med"],
            output_score_column_name_cli_param: ["score"],
            "run_locally": True,

        }
        return [
            (
                RayTransformLauncher(ClassificationRayTransformConfiguration()),
                config,
                basedir + "/input",
                basedir + "/expected",
            )
        ]

